/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.huongpq.btvn2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.security.util.BigInt;

/**
 *
 * @author Admin_Pro
 */
public class Bai4 {

    public static void main(String[] args) {
        File f = new File("bai 4.txt");
        try {
            f.createNewFile();

            FileReader fr = new FileReader(f);
            BufferedReader br = new BufferedReader(fr);

            String a;
            while ((a = br.readLine()) != null) {
                try {
                    StringTokenizer s = new StringTokenizer(a);
                    String a1;
                    a1 = s.nextToken();
                    BigInteger t = new BigInteger(a1);
                    a1 = s.nextToken();
                    BigInteger t1 = new BigInteger(a1);
                    System.out.println(t + " + " + t1 + " = " + t.add(t1));
                    System.out.println(t + " - " + t1 + " = " + t.subtract(t1));
                    System.out.println(t + " x " + t1 + " = " + t.multiply(t1));
                    System.out.println(t + " / " + t1 + " = " + t.divide(t1));
                    System.out.println("_____________________________________");
                } catch (Exception e) {
                    System.out.println(a + " khong phai la mot cap so.");
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(Bai4.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
